Bash string processing (against Java)-2. String Representation (String constant)
In JavaYou know!Use single quotes to indicate character constants: 'C'Double quotation marks are used to indicate a String constant: "hello world" Java character escape\
First of all, in the bash script, there are three kinds of quotes
1. Single quotes '2. Double quotes "3. Inverted quotes '
Single quotation markThe two string enclosed in single quotes is an ordinary string that retains its original literal
Transfer from http://blog.chinaunix.net/uid-20328094-id-95121.htmlA very good bash scripting tutorial, at least not in contact with bash can read!Create a scriptThere are many different shells in Linux, but usually we use Bash (Bourne again shell)
One, the basic Bash Shell command 1, the default bash shell prompt is the dollar sign ($); 2. The Bash manual uses the man command to access the manual pages stored on the Linux system, such as:
Bogon:~ mac$ man Kill
KILL (1) BSD
Here is a bash script compilation tutorial written by old American. It is very good. At least I have never touched bash and can understand it!Create a scriptLinux has many different shells, but we usually use Bash (Bourne again shell) for shell
1. Initial knowledge of Bash Start by compiling a simple bashVim Hello. SHUsing Vim to edit hello.sh, enter the following code and Save:#!/bin/bashecho Hello WordHow to run the Bash script:sh hello. SH # Use Bash to execute bash hello. SHYou can
Shell Features--Linux has a variety of shells to use, the default for Bash,bash has the following key features.1. Command Memory AbilityPress the up and down keys on the command line to find a pre/Post input command. These commands are recorded in ~/
3.1.2 Quoting-------------* Menu:* Escape Character::how to remove the special meaning from a singleCharacter.* Single quotes::how to inhibit all interpretation of a sequenceof characters.* Double Quotes::how to suppress most of the interpretation
Script Security
All of my bash scripts start with the following lines:
The code is as follows
Copy Code
#!/bin/bashSet-o NounsetSet-o Errexit
Doing so avoids two common problems:
Reference to an undefined
Shell is a commonly used script for interpretation in Linux. It contains many types and is widely used in bashshell. Shell files can be seen everywhere in the android source code, for this reason, make a memo (for details, shell can be published
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.